package taobao.config;

import com.yanqu.road.entity.activity.ActivityConfig;

import java.util.Map;

public class TaoBaoConfig {
    private String refreshTime;
    private String tagNumParam;
    private String tagTypeParam;
    private int bargainTime;

    public String getRefreshTime() {
        return refreshTime;
    }

    public void setRefreshTime(String refreshTime) {
        this.refreshTime = refreshTime;
    }

    public String getTagNumParam() {
        return tagNumParam;
    }

    public void setTagNumParam(String tagNumParam) {
        this.tagNumParam = tagNumParam;
    }

    public String getTagTypeParam() {
        return tagTypeParam;
    }

    public void setTagTypeParam(String tagTypeParam) {
        this.tagTypeParam = tagTypeParam;
    }


    public int getBargainTime() {
        return bargainTime;
    }

    public void setBargainTime(int bargainTime) {
        this.bargainTime = bargainTime;
    }

    public static TaoBaoConfig parseConfig(Map<String, ActivityConfig> activityConfigMap) {
        TaoBaoConfig config = new TaoBaoConfig();
        config.setRefreshTime(activityConfigMap.get("TAOBAO_REFRESH_TIME").getValue());
        config.setTagNumParam(activityConfigMap.get("TAOBAO_TAG_NUM").getValue());
        config.setTagTypeParam(activityConfigMap.get("TAOBAO_TAG_LOW_TYPE_NUM").getValue());
        config.setBargainTime(activityConfigMap.get("TAOBAO_BARGAIN_TIMES").getIntValue());

        return config;
    }
}
